<template>
	<view class="lang-opt-vison">
		<view class="lang-opt-view">
			<radio-group @change="radioChange">

				<view class="lang-opt-li" v-for="(item, index) in langOptList" :key="item.value">
					<view class="name">
						{{item.name}}
					</view>
					<radio :value="item.value" :checked="index === current" />
				</view>
			</radio-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				langOptList: [{
					name: 'EN(English)',
					value:'EN',
					checked: true
				}, {
					name: 'CN(简体中文)',
					value:'CN',
					checked: true
				}, {
					name: 'CN(繁体中文)',
					value:'TW',
					checked: true
				}, ],
			}
		},
		onShareAppMessage() {},
		onNavigationBarButtonTap(e) {},

		watch: {},

		methods: {
			radioChange(evt) {
				for (let i = 0; i < this.langOptList.length; i++) {
					if (this.langOptList[i].value === evt.detail.value) {
						this.current = i;
						break;
					}
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.lang-opt-vison {
		padding-top: 30rpx;
	}

	@mixin main-view {
		width: 92%;
		margin-left: 4%;
		padding: 0 30rpx;
		background: #FFFFFF;
		border-radius: 10rpx;
		box-sizing: border-box;
	}

	.lang-opt-view {
		@include main-view;
		margin-bottom: 30rpx;

		.lang-opt-li {
			display: flex;
			align-items: center;
			justify-content: space-between;
			box-sizing: border-box;
			height: 112rpx;
			width: 100%;
			// padding: 0 30rpx;
			border-bottom: 1rpx solid #EEEEEE;


			.name {
				font-size: 28rpx;
				color: #333333;
			}
		}
	}
</style>